<template>
    <div>
        <h1>404 页面走丢了</h1>
        <p>{{ timer }}秒后跳转到首页</p>
    </div>
</template>

<script>
export default {
    data() {
        return {
            timer: 5
        }
    },
    mounted() {
        this.countdown();
    },
    methods: {
        countdown() {
            setInterval(() => {
                this.timer--;
                if(this.timer == 0){
                    this.$router.push('/')
                }
            }, 1000);
        }
    },
}
</script>

<style>

</style>